public enum Request {

	CONNECT(0), DISCONNECT(1), REGISTER(2), UNREGISTER(3), SEND(4);

	private final int id;

	public int getId() {
		return id;
	}

	private Request(int id) {
		this.id = id;
	}
	
	public static Request getRequestById(int id) {
		for (Request request : Request.values()) {
			if (request.getId() == id)
				return request;
		}
		return null;
	}
}
